<?php
header('content-type:text/html;charset=utf-8');
include 'functions.php';
$db = include 'db.php';

//删除数组中对应的元素
$key = $_GET['key'];
unset($db[$key]);

//组合要写回去的数据
$backarr = "<?php \r\n return ".var_export($db,true)."\n\r ?>";
//将新的数据写回去
file_put_contents('db.php',$backarr);

echo '
<script>
alert(\'删除成功！！！\');
location.href = \'../index.php\';
</script>
';





























